<template>
	<view class="price">
		<view class="unit">¥</view>
		<view class="price">{{integer}}</view>
		<view class="Point">{{decimal}}</view>
		<view class="unit" style="margin-left: 5rpx;" v-if="max_price!=min_price">起</view>
	</view>
</template>

<script>
	import _ from 'lodash'
	export default {
		data() {
			return {
				show: false
			}
		},
		props: {
			min_price: {
				type: String,
				default () {
					return '0.00'
				}
			},
			max_price: {
				type: String,
				default () {
					return '0.00'
				}
			},
		},
		computed: {
			integer: function() {
				var price = 0
				if (String(this.min_price).includes('.')) {
					price = _.split(this.min_price, '.', 2)[0];
				} else {
					price = this.min_price
				}
				return price
			},
			decimal: function() {
				var price = 0
				if (String(this.min_price).includes('.')) {
					price = '.' + _.split(String(this.min_price), '.', 2)[1];
				} else {
					price = ''
				}
				return price
			},
		},
		methods: {
			chooseImage() {

			},
		}
	}
</script>
<style scoped lang="scss">
	.price {
		display: flex;
		justify-content: flex-start;
		align-items: flex-end;
		flex-wrap: nowrap;
		flex-direction: row;
		align-content: flex-start;
		line-height: 98rpx;
		.unit {
			font-family: PingFangSC-Medium;
			font-size: 26rpx;
			color: #ffffff;
			text-align: center;
			font-weight: 500;
			line-height: 80rpx;
			margin-right: 10rpx;
		}

		.price {
			font-family: PingFangSC-Medium;
			font-size: 47rpx;
			color: #ffffff;
			font-weight: 500;
			line-height: 98rpx;
		}

		.Point {
			font-family: PingFangSC-Medium;
			font-size: 38rpx;
			color: #ffffff;
			font-weight: 500;
			line-height: 90rpx;
		}
	}
</style>